package com.mango.module.ldap.mapper;

import javax.naming.NamingException;
import javax.naming.directory.Attributes;

import org.springframework.ldap.core.AttributesMapper;

import com.mango.module.ldap.domain.DepartDO;

/**
 * 部门字段映射
 * @author Mango-Lab
 * @Date 2021年4月8日
 */
public class DepartAttributesMapper implements AttributesMapper<DepartDO> {
 
    @Override
    public DepartDO mapFromAttributes(Attributes attrs) throws NamingException {
    	DepartDO depart = new DepartDO();
    	depart.setCode((String)attrs.get("ou").get());
    	depart.setDescription((String)attrs.get("description").get());
        return depart;
    }
}

